// <copyright file="Role.cs" company="EnterpriseApi">
// Copyright (c) EnterpriseApi. All rights reserved.
// </copyright>

namespace EnterpriseApi.Models;

/// <summary>
/// 角色实体类，代表系统中的用户角色
/// </summary>
public class Role
{
    /// <summary>
    /// 角色唯一标识符
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 角色名称
    /// </summary>
    public required string Name { get; set; }

    /// <summary>
    /// 角色描述
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 角色创建时间
    /// </summary>
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    /// <summary>
    /// 角色最后更新时间
    /// </summary>
    public DateTime? UpdatedAt { get; set; }

    /// <summary>
    /// 拥有该角色的用户集合
    /// </summary>
    public ICollection<User> Users { get; set; } = new List<User>();
}